Release 10.1A: OpenEdge Development:
Progress 4GL Reference


MAXIMUM function

Compares two or more values and returns the largest value.

Syntax

MAXIMUM ( expression , expression [ , expression ] ... ) 

expression

A constant, field name, variable name, or expression. If there is a mixture of decimal and integer data types, decimal type is returned.

Example

In this procedure, if the credit-limit value is under 20,000, the procedure adds 10,000 to that value. Otherwise, the procedure sets credit-limit to 30,000. The MAXIMUM function determines the greater of the original credit-limit value and the new cred-lim2 value.

r-maxmum.p
DEFINE VARIABLE cred-lim2 AS DECIMAL
    FORMAT ">>,>>9.99".FOR EACH customer:
    IF credit-limit < 20000 THEN cred-lim2 = credit-limit + 10000.
    ELSE cred-lim2 = 30000.
    DISPLAY credit-limit cred-lim2
      MAXIMUM(cred-lim2, credit-limit) 
      LABEL "Maximum of these two values".
END. 

Notes

See also

MINIMUM function


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095